#include <map>

#include "unit_category.hpp"

namespace game {

std::map<std::string, UnitCategory> category_map;

UnitCategory next_category = 1;

UnitCategory get_unit_category(const std::string& key)
{
	UnitCategory& cat = category_map[key];
	if(cat == 0) {
		cat = next_category;
		next_category <<= 1;
	}

	return cat;
}

}
